-
-
Notifications
You must be signed in to change notification settings - Fork 749
BrowserWindowOptions; Fix default and add more Tests #945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Electron's default is true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the default value for the Fullscreenable property in BrowserWindowOptions to match Electron's true default and adds comprehensive integration tests for window state management. The PR title contains a minor formatting issue ("BrowserWindowOptions; Fix default and add more Tests" has an extra space before "and").
- Fixed
Fullscreenableproperty to default totrueinstead offalse, aligning with Electron's behavior - Added resource cleanup (try-finally blocks) to existing tests to prevent resource leaks
- Added six new integration tests covering fullscreen, maximize, minimize operations and their associated events
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/ElectronNET.API/API/Entities/BrowserWindowOptions.cs | Fixed Fullscreenable default value to true with [DefaultValue(true)] attribute and inline initialization, updated documentation comment |
| src/ElectronNET.IntegrationTests/Tests/BrowserWindowTests.cs | Wrapped existing tests in try-finally blocks for proper cleanup, added 6 new tests for window state operations, and introduced a WaitUntil helper method for polling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bb2eb4e to
1815951
Compare
FlorianRappl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks!
|
This probably the explanation for why that serialization option "IgnoreDefaults" has been there. I'm not sure whether this is already the right thing. Probably there are types of windows (like tool window or dialog) which may not be "FullScreenable" and Electron might error. I think the most safe and correct way would be to make all non-string properties nullable. This comes closest to the JS development behavior where you just omit those properties that you don't want to set. Right now we need to see which defaults Electron has and set them accordingly. But when there's no constant default, this doesn't work out. Most likely, that's where somebody came up with the "IgnoreDefault" serialization option... |
Electron's default is trueElectron's default for FullScreenable is true